package com.shanghaionstar.report.bean;


import java.util.List;

/**
 * @author 4180zt
 */
public class EventDTO {


    /**
     * 事件类型
     */
    private String type;

    /**
     * 功能ID
     */
    private String functionID;

    /**
     * 操作行为的对象类型，如banner
     */
    private String objectType;

    /**
     * 操作行为的对象标识,如bannerID
     */
    private String objectID;

    /**
     * 行为发生时间
     */
    private long timestamp;

    /**
     * 操作类型   ：click
     */
    private String operation;

    /**
     * 行为开始时间
     */
    private long startTimestamp;

    /**
     * 行为结束时间
     */
    private long endTimestamp;

    /**
     * 行为结果  ,0成功 1失败  2	异常
     */
    private String result;

    /**
     * 行为描述
     */
    private String description;

    /**
     * 标签，预留
     */
    private String tag;

    /**
     * 当前操作语言
     */
    private String language;

    /**
     * 扩展字段，json字符串key:value
     */
    private List<ExtensionDTO> extra;

    public EventDTO() {
    }

    public EventDTO(String type, String functionID, String objectType,
                    String objectID, long timestamp, String operation,
                    long startTimestamp, long endTimestamp, String result,
                    String description, String tag, String language,
                    List<ExtensionDTO> extra) {
        this.type = type;
        this.functionID = functionID;
        this.objectType = objectType;
        this.objectID = objectID;
        this.timestamp = timestamp;
        this.operation = operation;
        this.startTimestamp = startTimestamp;
        this.endTimestamp = endTimestamp;
        this.result = result;
        this.description = description;
        this.tag = tag;
        this.language = language;
        this.extra = extra;
    }

    public static class EventBuilder {

        /**
         * 事件类型
         */
        private String type;

        /**
         * 功能ID
         */
        private String functionID;

        /**
         * 操作行为的对象类型，如banner
         */
        private String objectType;

        /**
         * 操作行为的对象标识,如bannerID
         */
        private String objectID;

        /**
         * 行为发生时间
         */
        private long timestamp;

        /**
         * 操作类型   ：click
         */
        private String operation;

        /**
         * 行为开始时间
         */
        private long startTimestamp;

        /**
         * 行为结束时间
         */
        private long endTimestamp;

        /**
         * 行为结果  ,0成功 1失败  2	异常
         */
        private String result;

        /**
         * 行为描述
         */
        private String description;

        /**
         * 标签，预留
         */
        private String tag;

        /**
         * 当前操作语言
         */
        private String language;

        /**
         * 扩展字段，json字符串key:value
         */
        private List<ExtensionDTO> extra;

        public EventBuilder type(String type) {
            this.type = type;
            return this;
        }

        public EventBuilder functionID(String functionID) {
            this.functionID = functionID;
            return this;
        }

        public EventBuilder objectType(String objectType) {
            this.objectType = objectType;
            return this;
        }

        public EventBuilder objectID(String objectID) {
            this.objectID = objectID;
            return this;
        }

        public EventBuilder timestamp(long timestamp) {
            this.timestamp = timestamp;
            return this;
        }

        public EventBuilder operation(String operation) {
            this.operation = operation;
            return this;
        }

        public EventBuilder startTimestamp(long startTimestamp) {
            this.startTimestamp = startTimestamp;
            return this;
        }

        public EventBuilder endTimestamp(long endTimestamp) {
            this.endTimestamp = endTimestamp;
            return this;
        }

        public EventBuilder result(String result) {
            this.result = result;
            return this;
        }

        public EventBuilder description(String description) {
            this.description = description;
            return this;
        }

        public EventBuilder tag(String tag) {
            this.tag = tag;
            return this;
        }

        public EventBuilder language(String language) {
            this.language = language;
            return this;
        }

        public EventBuilder extra(List<ExtensionDTO> extra) {
            this.extra = extra;
            return this;
        }

        public EventDTO creatEventDTO() {
            return new EventDTO(
                    type, functionID, objectType,
                    objectID, timestamp, operation,
                    startTimestamp, endTimestamp, result,
                    description, tag, language,
                    extra);
        }
    }


    public String getType() {
        return type;
    }

    public String getFunctionID() {
        return functionID;
    }


    public String getObjectType() {
        return objectType;
    }


    public String getObjectID() {
        return objectID;
    }

    public long getTimestamp() {
        return timestamp;
    }


    public String getOperation() {
        return operation;
    }


    public long getStartTimestamp() {
        return startTimestamp;
    }


    public long getEndTimestamp() {
        return endTimestamp;
    }


    public String getResult() {
        return result;
    }


    public String getDescription() {
        return description;
    }


    public String getTag() {
        return tag;
    }


    public String getLanguage() {
        return language;
    }


    public List<ExtensionDTO> getExtra() {
        return extra;
    }


    public void setType(String type) {
        this.type = type;
    }

    public void setFunctionID(String functionID) {
        this.functionID = functionID;
    }

    public void setObjectType(String objectType) {
        this.objectType = objectType;
    }

    public void setObjectID(String objectID) {
        this.objectID = objectID;
    }

    public void setTimestamp(long timestamp) {
        this.timestamp = timestamp;
    }

    public void setOperation(String operation) {
        this.operation = operation;
    }

    public void setStartTimestamp(long startTimestamp) {
        this.startTimestamp = startTimestamp;
    }

    public void setEndTimestamp(long endTimestamp) {
        this.endTimestamp = endTimestamp;
    }

    public void setResult(String result) {
        this.result = result;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public void setTag(String tag) {
        this.tag = tag;
    }

    public void setLanguage(String language) {
        this.language = language;
    }

    public void setExtra(List<ExtensionDTO> extra) {
        this.extra = extra;
    }
}
